package com.bcbim.model_server_interface.file.vo;

import com.bcbim.common.response.annotation.TranslationField;
import com.bcbim.model_server_interface.file.dao.FileDAO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description: 文件信息
 * @Author: ye
 * @Date: 2022/5/6
 * @Version: V1.0
 **/
@Data
public class FileInfoVO implements Serializable {
    /**
     * iid
     */
    private String id;
    /**
     * 文件名字
     */
    private String fileName;
    /**
     * 文件状态
     */
    @TranslationField(typeFlag = "fileStatusType")
    private String status;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private LocalDateTime createTime;
    public FileInfoVO() {

    }

    public FileInfoVO(FileDAO fileDAO) {
        if (fileDAO == null) {
            return;
        }
        id = fileDAO.getId();
        fileName = fileDAO.getFileName();
        status = fileDAO.getFileStatusType();
        createTime = fileDAO.getCreateTime();
    }
}
